<template>
<div>
	<div class="container" id="container">

	</div>

</div>

</template>


<script>
	import * as d3 from '../../../static/libs/d3-3.min';
	import graphHeatmap from 'src/util/heatmap';

	let module = 'graph';

	export default {
		data() {
			return {
				graph_data: [],
				params: {
					type: 'heatmap',
				},
				url: pub.apiDomain + module,
				cacheKey: module + '_list',
 			}
		},

		created() {
			this.getData();
			// this.draw();
		},
		methods: {
			async getData() {
				this.$axios.post(this.url + '/draw', this.params)
					.then(res => {
						this.graph_data = res.d;
						graphHeatmap.blockHeatmap("container", res.d);
					});
			},
			draw() {
				graphHeatmap.blockHeatmap("container", this.graph_data);
			}
		},
	}

</script>